#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n, k;
LL q[N];
LL pre_sum[N];


void solve(){
    cin >> n >> k;
    for(int i = 1; i <= n; i ++){
        cin >> q[i];
        pre_sum[i] = pre_sum[i - 1] + q[i];
    }

    if(k == 1 || k == n){
        cout << "YES" << '\n';
        return;
    }

    int l = k - 1, r = k;
    LL leftmax = 0;
    LL cursum = q[k];
    for(int i = r; i <= n; i ++){
        cursum = pre_sum[i] - pre_sum[r - 1];
        for(int j = l; j >= 1; j --){
            LL t = pre_sum[k - 1] - pre_sum[j - 1];
            if(t + cursum < 0) break;
            if(j == 1){
                cout << "YES" << '\n';
                return;
            }
            leftmax = max(leftmax, t);
            l = j;
        }

        if(cursum + leftmax < 0){
            cout << "NO" << '\n';
            return;
        }

        if(i == n){
            cout << "YES" << '\n';
            return;
        }
    }
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        solve();
    }

    return 0;
}